<?php
defined('BASEPATH') OR exit('No direct script access allowed');

class Auth extends MY_Controller {

    public function __construct(){

        parent::__construct();
        $this->load->model('User_model','User');
    }
    

    public function login_to_admin(){
        if(!empty($_SESSION["currentUser"])){
            redirect('admin/index');
        }
        $this->loadHead( "仪器预约-登录", "" );
        $this->load->view('Auth/login_to_admin.php');
    }

	public function logoutSuccess(){
		$this->loadHead( "You are logout", "" );
		$this->loadView( $this->getViewBag(), 'Auth', 'logout' );
	}

    /**
     * logout
     */
    public function logout(){

        $this->session->sess_destroy();
        //success('','Success Sign out！');
		redirect('auth/login');
    }

    public function admin_logout(){
        $this->session->sess_destroy();
        //success('','Success Sign out！');
		redirect('auth/login_to_admin');
    }

    /**
     * getsms
     */

    public function getsms(){

        $this->loadHead( "仪器预约 - 忘记密码", "" );
        $this->loadView( $this->getViewBag(), "Auth", "getsms" );
    }
}